<?php
  $config = array(
    "host" => "localhost",
    "username" => 'root',
    "password" => '',
    "dbname" => 'dnf-shop-project'
  );

  // 连接数据库服务器
  mysql_connect($config['host'], $config['username'], $config['password']);

  // 选择数据库
  mysql_select_db($config['dbname']);

  // 设置编码
  mysql_query("set charset 'utf8'");
  mysql_query("set character set 'utf8'");

?>